﻿<!DOCTYPE HTML>
<html>
<head>
	<meta http-equiv="content-type" content="text/html; charset=utf-8">
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
</head>
<body>
<table id="tb-ote" width="90%" style="margin-left:30px;margin-top:20px;height:170px;font-weight: bold;">
	<tr>
		<td>事项日期</td>
		<td width="10%">&nbsp;</td>
		<td><input class="easyui-validatebox" readonly type="text" id="other-feedbackdate" style="width:243px;"></input></td>
	</tr>
	<tr>
		<td>上/下午</td>
		<td>&nbsp;</td>
		<td style="align:right">
			<select id="other-daytype" class="easyui-combobox" data-options="panelHeight:'auto'" style="width:250px;">
				<option selected value="am">上午</option>
				<option value="pm">下午</option>
				<option value="all">全天</option>
			</select>
		</td>
	</tr>
	<tr>
		<td>事项类型</td>
		<td>&nbsp;</td>
		<td>
			<select id="other-activitydic" class="easyui-combobox" style="width:250px;" data-options="valueField:'id',textField:'text',panelHeight:'auto',required:true">
				<option>请选择</option>
			</select>
		</td>
	</tr>
	<tr>
		<td>备注</td>
		<td>&nbsp;</td>
		<td>
			<textarea style="width:245px;height:70px" id="other-desc"></textarea>
		</td>
	</tr>			
</table>

<script>	
	getOtherInfo();
	
	/**
		获取其他反馈初始数据
	*/
	function getOtherInfo(){
		var paramsstr = "{'cudate':'"+ovaldateStr+"','employeeid':"+oval_user_search+",'visitotherinfoid':"+visitotherinfoid+"}";
		var variable = new Array('__methodName', '__token', 'pagename', 'actionname','__params');
		var value = new Array('wsActionJSON', token, 'p_visitother', 'getotherinfo',paramsstr);
		var dataStr = getJsonData(variable, value);
		connectionServlet(dataStr, getOtherInfoCallback);
	}
	
	function getOtherInfoCallback(data){
		if(data.successflag=="true"){
			$('#other-feedbackdate').val(ovaldateStr);
			$('#other-activitydic').combobox('loadData',data.result.visitactivitydic);
			if(data.result.otherinfo.visitotherinfoid != undefined){
				visitotherinfoid = data.result.otherinfo.visitotherinfoid;
				$('#other-daytype').combobox('setValue',data.result.otherinfo.daytype);
				$('#other-activitydic').combobox('setValue',data.result.otherinfo.activityvalue);
				$('#other-desc').val(data.result.otherinfo.description);
			}
		}
	}
	
	/**
		保存其他反馈数据
	*/
	function saveOtherInfo(){
		var activityvalue = $('#other-activitydic').combobox('getValue');
		var activitydesc = $('#other-activitydic').combobox('getText');
		var daytype = $('#other-daytype').combobox('getValue');
		var description = $('#other-desc').val();
		oval_msg = '数据保存成功！';
		if(activityvalue=="请选择"){
			$.messager.alert('提示','请选择事项类型！','info');
			return;
		}
		var paramsstr = "{'operate':'save','employeeid':"+oval_user_search+",'activityvalue':'"+activityvalue+"','activitydesc':'"+activitydesc+"','feedbackdate':'"+ovaldateStr+"','description':'"+description+"','daytype':'"+daytype+"','visitotherinfoid':"+visitotherinfoid+"}";
		var variable = new Array('__methodName', '__token', 'pagename', 'actionname','__params');
		var value = new Array('wsActionJSON', token, 'p_visitother', 'saveotherinfo',paramsstr);
		var dataStr = getJsonData(variable, value);
		connectionServlet(dataStr, saveOtherInfoSuccess);
	}
	/**
		删除其他反馈数据
	*/
	function deleteOtherInfo(){
		$.messager.confirm('警告','是否删除?', function(r){
			if (r){
				oval_msg = '数据已经删除！';
				var paramsstr = "{'operate':'delete','visitotherinfoid':"+visitotherinfoid+"}";
				var variable = new Array('__methodName', '__token', 'pagename', 'actionname','__params');
				var value = new Array('wsActionJSON', token, 'p_visitother', 'saveotherinfo',paramsstr);
				var dataStr = getJsonData(variable, value);
				connectionServlet(dataStr, saveOtherInfoSuccess);
			}
		});	
	}
	/**
		操作回调提示
	*/
	function saveOtherInfoSuccess(data){
		if(data.successflag=="true"){
			$('#dlg-ote').dialog('close');	
			$.messager.show({
				title:'提示',
				msg: oval_msg,
				timeout:3000,
				showType:'slide'
			});
			refresh();
		}
	}	
</script>
<body>
<html>